#include "table.h"

table::table(QWidget *parent)
	: QWidget(parent)
{
	ui.setupUi(this);

	setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);

	//connect(ui.tableWidget_ws, SIGNAL(itemEntered(QTableWidgetItem *)), this,SLOT( slotItemEntered(QTableWidgetItem *)));
	
	connect(ui.tableWidget_ws, SIGNAL(selected(double)), this,SLOT(setTableItem(double)));

	tableInitial();
}

table::~table()
{

}

void table::tableInitial()
{
	ui.tableWidget_ws->setItem(0, 0, new QTableWidgetItem("579.0"));
	ui.tableWidget_ws->setItem(1, 0, new QTableWidgetItem("577.0"));
	ui.tableWidget_ws->setItem(2, 0, new QTableWidgetItem("546.1"));
	ui.tableWidget_ws->setItem(3, 0, new QTableWidgetItem("435.8.0"));
	ui.tableWidget_ws->setItem(4, 0, new QTableWidgetItem("404.7"));
}

void table::factorCalculate(double namda, int pos)
{
	
}

void table::slotItemEntered(QTableWidgetItem *item)
{

}

void table::setTableItem(double x_pos)
{
	x_peak_pos = x_pos;
}
void table::showItem()
{
	ui.tableWidget_ws->setItem(0, 1, new QTableWidgetItem("000"));
}